home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
russell
/
c_calc.lha
/
README
< prev
next >
Wrap
Text File
|
1993-07-29
|
6KB
|
137 lines
Copyright 1988, 1989 Hans-J. Boehm, Vernon Lee, Alan J. Demers
Copyright Digital Equipment Corporation & INRIA 1988, 1989
Copyright (c) 1990-1993 by Xerox Corporation. All rights reserved.
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
Permission is hereby granted to copy this calculator utility for any
non-commercial purpose, provided the above notices are retained on all copies.
Further restrictions apply to the DEC/INRIA BigNum package. These are stated
in the file runtime/BigNum/doc/bnbody.tex.
This work uses the BigNum package developed jointly by INRIA and
Digital PRL. It has been modified by Hans-J. Boehm in August 1990
and February 1993 at Xerox PARC. When you receive this software,
please send mail to librarian@prl.dec.com to inform them that you
have a copy of the package.
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
-----------------------------------
This is version 2.9 of a desk calculator utility that operates on
constructive real numbers. The file "calc.man" contains a manual page.
The underlying idea is to represent a real number as a
function from a precisions specification to an approximation accurate to
the indicated precision. For efficiency reasons, these functions "remember"
the best known approximation to a number. More details on the ideas
underlying the implementation can be found in:
Hans-J. Boehm, "Constructive Real Interpretation of Numerical Programs",
Proceedings of the SIGPLAN '87 Symposium on Interpreters and Interpretive
Techniques, SIGPLAN Notices 22, 7 (July 1987), pp. 241-221.
Hans-J. Boehm, R. Cartwright, Michael J. O'Donnell, and Mark Riggle,
"Exact Real Arithmetic: A Case Study in Higher Order Programming",
Proceedings of the 1986 Lisp and Functional Programming Conference,
pp. 162-173.
The implementation makes use of some of the algorithms used in Brent's
multiple precision package. These are described in:
Brent, R.P., "Fast Multiple-Precision Evaluation of Elementary Functions",
Journal of the ACM 23, (1976), pp. 242-251.
The underlying constructive real package, as well as the desk calculator
interface to it, are written in the programming language Russell. A Russell
compiler along with source for the constructive reals package is available
by ftp from arisia.xerox.com. If you are interested, please send mail to
boehm@xerox.com.
This distribution contains C source for the Russell run-time system,
C source for some small routines specific to the calculator, and
C code for the calculator itself. The latter was automatically generated
from the Russell code, and is not human readable. If you have need for
the Russell source, send mail to boehm@xerox.com.
The code included here is at best semi-portable. See the INSTALLATION
file for installation instructions. The calculator has been run as is
on Sun 3s, Sun 4s, and Vaxen (under BSD UN*X). It has been run with
minor modifications to Makefiles on a MIPS M/120 and on an IBM RS/6000.
(We also have a Sun 3 binary distribution, which is more compact, and
somewhat easier to install.)
Performance on various machines may not be what you expect. Most modern
RISC architectures do not do very well when it comes to integer multiplication
and especially division. This is especially true for SPARC. This version
of the caculator is tuned to avoid division in favor of Newton iteration
reciprocals, so it does relatively well on machines like the MIPS that have
fast multiplication, but relatively slow 64 by 32 bit division.
The file "calc_icon" is a sunview icon that suitable for use as an
iconic representation with the calculator. Under sunview, it is reasonable
to add the following line to .rootmenu:
calc /usr/bin/shelltool -Ww 60 -Wh 23 ?/calc -Wl "calculator"
-WI ?/calc_icon -WL ""
The file "lib.o" will contain a C callable version of the functions used by
the calculator. Xcr.r contains a cryptic description of what the functions are.
Authors: Hans-J. Boehm & Vernon Lee
boehm@xerox.com scorpion@rice.edu
The garbage collector and BigNum components were developed by different
groups, as described in those subdirectories.
This work was supported in part by NSF grants MCS81-21844, DCR-8607200,
DCR84-03530, by DARPA/NSF grant CCR 87-20277, and by IBM corporation.
Some of the work was done at Xerox by the first author.
Brief history of updates:
Version 2.0:
Unannounced, probably in use primarily at Rice.
Version 2.1
Fixed curses related bug that left tty in no echo mode on some machines.
Version 2.2
Replaced BigNum package with new version from DEC PRL. SPARC version up to
30% faster.
Version 2.3
Fixed bug in remainder operation in runtime/long.c. This resulted in incorrect
primality tests when the number being tested was a multiple of 32 bits in
length.
Version 2.4
Added history facility and Fortranish floating point input.
Version 2.5
Bug fix.
Version 2.6
Added minimal support for C interface through lib.o.
Version 2.7
Fixed some curses related bugs that tended to show up with small or resized
windows.
Version 2.8
Fixed an obscure bug in the DEC/INRIA BigNum package. It could lead to
incorrect results, especially for rational operations. Incorrect results were
unlikely for the calculator, but could occur fairly easily through library
calls.
Thanks to Mike Convey (mjc-b@minster.york.ac.uk) for noticing the
problem.
Version 2.9
Moved to the new garbage collector interface, thus improving portability
somewhat.